<!doctype html>
<html xmlns:fb="http://www.facebook.com/2008/fbml">
  <head>
    <title>php-sdk</title>
    <style>
      body {
        font-family: 'Lucida Grande', Verdana, Arial, sans-serif;
      }
      h1 a {
        text-decoration: none;
        color: #3b5998;
      }
      h1 a:hover {
        text-decoration: underline;
      }
    </style>
  </head>
  <body>
    <h1>php-sdk</h1>
      <a href="/index/face-login">AdapterLogin</a>
    <?php if ($this->user): ?>
      <a href="<?php echo $this->loginUrl; ?>">Logout</a>
    <?php else: ?>
      <div>
        Login using OAuth 2.0 handled by the PHP SDK:
        <a href="<?php echo $this->loginUrl; ?>">Login with Facebook</a>
      </div>
    <?php endif ?>

    <h3>PHP Session</h3>
    <pre><?php print_r($_SESSION); ?></pre>

    <?php if ($this->user): ?>
      <h3>You</h3>
      <img src="https://graph.facebook.com/<?php echo $this->user; ?>/picture">

      <h3>Your User Object (/me)</h3>
      <pre><?php print_r($this->user_profile); ?></pre>
    <?php else: ?>
      <strong><em>You are not Connected.</em></strong>
    <?php endif ?>

    <h3>Amigos de Raphael Almeida</h3>
    <?php foreach ($this->friends as $friend): ?>
        <a href="http://facebook.com/<?=$friend['id']; ?>">
            <img src="https://graph.facebook.com/<?=$friend['id']; ?>/picture" alt="<?=$friend['name']; ?>" title="<?=$friend['name']; ?>" >
        </a>
    <? endforeach;?>
  </body>
</html>